﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
/// <summary>
/// Summary description for UcControls
/// </summary>
namespace WB.Controls
{
    public class UcControls : System.Web.UI.UserControl
    {
        public int pageCurrent = 1;
        public int pageCount = 0;

        public UcControls()
        {
        }

        public void RefreshPage()
        {
            Response.Redirect(Request.RawUrl);
        }

        public void Redirect(string menu, string control, params string[] param)
        {
            string url = Request.PhysicalPath + "?";
            if (menu != "nothing")
            {
                if (!string.IsNullOrEmpty(menu))
                {
                    url += "menu=" + menu;
                }
                else
                {
                    url += "menu=" + Request["menu"];
                }
            }
            else
                url += "menu=";

            url += "&control=" + control;
            if (param.Length > 0)
                url += "&" + string.Join("&", param);
            Response.Redirect(url);
           
        }
    }
}